﻿using Autofac;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Loong.Dependency;
using Loong.Domain.Uow;
using Loong.EntityFrameworkCore.Uow;
using Loong.Modules;

namespace Loong.EntityFrameworkCore
{
    public sealed class EntityFrameworkCoreModule : Module, ILoongModule
    {
        public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
        }

        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterAssemblyByConvention(ThisAssembly);
            builder.RegisterType<EfCoreUnitOfWork>().As<IUnitOfWork>().InstancePerDependency();
        }

        public void Initialize()
        {
        }

        public void Shutdown()
        {
        }
    }
}
